<template>
  <div>
    <span>账号:</span>
    <el-input
      style="width: 200px; margin: 0 0 0 0.5vw"
      v-model="queryForm.username"
      placeholder="请输入内容"
      size="small"
    ></el-input>
    <!-- <el-input
      style="width: 200px; margin: 0 0 0 0.5vw"
      v-model="queryForm.local"
      placeholder="请输入内容"
      size="small"
    ></el-input> -->
    <span style="margin: 0 0 0 1vw">姓名:</span>
    <el-input
      style="width: 200px; margin: 0 0 0 0.5vw"
      v-model="queryForm.name"
      placeholder="请输入内容"
      size="small"
    ></el-input>
    <span style="margin: 0 0 0 1vw">角色:</span>
    <el-select
      size="small"
      v-model="queryForm.role"
      placeholder="请选择"
      style="margin: 0 0 0 0.5vw"
      clearable
    >
      <el-option
        v-for="item in locals"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      >
      </el-option>
    </el-select>
    <el-button
      style="margin: 0 0 0 1vw"
      size="small"
      type="primary"
      @click="seach"
      >搜索</el-button
    >
    <el-button
      style="margin: 0 0 0 1vw"
      size="small"
      type="primary"
      @click="add"
      v-if="$store.state.user.info.role == '2'"
      ><i class="el-icon-plus">新增</i></el-button
    >
    <!-- v-if="store.state.useinfo." -->
    <addUser ref="addUser" />
  </div>
</template>

<script>
import addUser from "./dialog/addUser.vue";
import { locals } from "./select/index";
export default {
  components: {
    addUser,
  },
  data() {
    return {
      locals: locals,
      queryForm: {
        username: "", //账号
        role: "", //角色
        name: "", //姓名
      },
    };
  },
  methods: {
    seach() {
      this.$emit("searches", this.queryForm);
    },
    add() {
      this.$refs.addUser.dialogVisible = true;
      this.$refs.addUser.title = "职工信息添加";
    },
  },
};
</script>

<style>
</style>